3.222 \(\int (B \cos (c+d x)+C \cos ^2(c+d x)) \sec ^3(c+d x) \, dx\)

Optimal. Leaf size=24 \[ \frac{B \tan (c+d x)}{d}+\frac{C \tanh ^{-1}(\sin (c+d x))}{d} \]

[Out]

(C*ArcTanh[Sin[c + d*x]])/d + (B*Tan[c + d*x])/d

________________________________________________________________________________________

Rubi [A]  time = 0.0623378, antiderivative size = 24, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 28, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.179, Rules used = {3010, 2748, 3767, 8, 3770} \[ \frac{B \tan (c+d x)}{d}+\frac{C \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Int[(B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^3,x]

[Out]

(C*ArcTanh[Sin[c + d*x]])/d + (B*Tan[c + d*x])/d

Rule 3010

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x
_Symbol] :> Dist[1/b, Int[(b*Sin[e + f*x])^(m + 1)*(B + C*Sin[e + f*x]), x], x] /; FreeQ[{b, e, f, B, C, m}, x
]

Rule 2748

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx &=\int (B+C \cos (c+d x)) \sec ^2(c+d x) \, dx\\ &=B \int \sec ^2(c+d x) \, dx+C \int \sec (c+d x) \, dx\\ &=\frac{C \tanh ^{-1}(\sin (c+d x))}{d}-\frac{B \operatorname{Subst}(\int 1 \, dx,x,-\tan (c+d x))}{d}\\ &=\frac{C \tanh ^{-1}(\sin (c+d x))}{d}+\frac{B \tan (c+d x)}{d}\\ \end{align*}

Mathematica [A]  time = 0.007535, size = 24, normalized size = 1. \[ \frac{B \tan (c+d x)}{d}+\frac{C \tanh ^{-1}(\sin (c+d x))}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x]^3,x]

[Out]

(C*ArcTanh[Sin[c + d*x]])/d + (B*Tan[c + d*x])/d

________________________________________________________________________________________

Maple [A]  time = 0.033, size = 32, normalized size = 1.3 \begin{align*}{\frac{B\tan \left ( dx+c \right ) }{d}}+{\frac{C\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x)

[Out]

B*tan(d*x+c)/d+1/d*C*ln(sec(d*x+c)+tan(d*x+c))

________________________________________________________________________________________

Maxima [A]  time = 1.32283, size = 51, normalized size = 2.12 \begin{align*} \frac{C{\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, B \tan \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x, algorithm="maxima")

[Out]

1/2*(C*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + 2*B*tan(d*x + c))/d

________________________________________________________________________________________

Fricas [B]  time = 1.65652, size = 162, normalized size = 6.75 \begin{align*} \frac{C \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - C \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, B \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x, algorithm="fricas")

[Out]

1/2*(C*cos(d*x + c)*log(sin(d*x + c) + 1) - C*cos(d*x + c)*log(-sin(d*x + c) + 1) + 2*B*sin(d*x + c))/(d*cos(d
*x + c))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c)**3,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.40596, size = 85, normalized size = 3.54 \begin{align*} \frac{C \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1 \right |}\right ) - C \log \left ({\left | \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1 \right |}\right ) - \frac{2 \, B \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 1}}{d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x, algorithm="giac")

[Out]

(C*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - C*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*B*tan(1/2*d*x + 1/2*c)/(tan(1
/2*d*x + 1/2*c)^2 - 1))/d